﻿using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace MvcSample.Filters
{
    public class GlobalLogExceptionFilter
        : IExceptionFilter
    {
        private readonly ILogger<GlobalLogExceptionFilter> _logger;
        public GlobalLogExceptionFilter(ILogger<GlobalLogExceptionFilter> logger)
        {
            _logger = logger;
        }
        public void OnException(ExceptionContext context)
        {
            var features = context.HttpContext.Features;
            
            _logger.LogError("Server interval error.");
        }
    }
}
